//
//  EJSCouponCCell.m
//  EnjoyShoppingStreet
//
//  Created by lifayu on 2017/12/19.
//  Copyright © 2017年 lifayu. All rights reserved.
//

#import "EJSCouponCCell.h"
#import "EJSCouponModel.h"

@implementation EJSCouponCCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.backgroundImageView.image = [[UIImage imageNamed:@"bg"] stretchableImageWithLeftCapWidth:300 topCapHeight:60];
    self.couponPriceLabel.adjustsFontSizeToFitWidth = YES;
}

-(void)setCouponModel:(EJSCouponModel *)couponModel{
    _couponModel = couponModel;
    self.couponPriceLabel.text = [NSString stringWithFormat:@"€ %@",couponModel.amount];
    self.couponNameLabel.text = couponModel.couponName;
    self.couponConditionLabel.text = [NSString stringWithFormat:@"满€ %@可用",couponModel.minLimit];
    self.couponLimitTimeLabel.text = [NSString stringWithFormat:@"%@ - %@",couponModel.startTime,couponModel.endTime];
}
- (IBAction)useItClicked:(id)sender {
    if (self.useItBlock) {
        self.useItBlock(self.couponModel.shopModel);
    }
}

@end
